package com.bkgy.modular.tbdistributionopt.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.tbdistributionopt.service.TbDistributionOptService;
import com.bkgy.sys.common.entity.JCommon;
import com.bkgy.sys.common.entity.ResultData;
import com.bkgy.util.CodiUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Author:Lipeng Zhao
 * Description:
 *
 * @Date:Created In 13:13 2025/10/23
 */
@RestController
@RequestMapping("/tbDistributionOpt")
public class TbDistributionOptController {

    @Autowired
    private TbDistributionOptService tbDistributionOptService;


    /**
     * 分页查看记录
     * @param data json字符串
     */
    @CrossOrigin
    @RequestMapping(value = {"/findByPage"}, method = RequestMethod.POST)
    @ResponseBody
    public ResultData findDataTbDistributionOptByPage(@RequestBody String data) {
        return tbDistributionOptService.findDataTbDistributionOptByPage(data);
    }

    @RequestMapping(value = {"/insertOne"}, method = RequestMethod.POST)
    @ResponseBody
    public ResultData insertOne(@RequestBody String data) {
        return tbDistributionOptService.insertOne(data);
    }

    @RequestMapping(value = {"/deleteOneById"}, method = RequestMethod.POST)
    @ResponseBody
    public ResultData deleteOneById(@RequestBody String data) {
        return tbDistributionOptService.deleteOneById(data);
    }


    @RequestMapping(value = {"/deleteManyByIds"}, method = RequestMethod.POST)
    @ResponseBody
    public ResultData deleteManyByIds(@RequestBody String data) {
        return tbDistributionOptService.deleteManyByIds(data);
    }


    @RequestMapping(value={"/update"}, method=RequestMethod.POST)
    @ResponseBody
    public ResultData updateDataTbDistributionOpt(@RequestBody JSONObject jsonObject){
        return tbDistributionOptService.updateDataTbDistributionOpt(jsonObject);
    }


}
